from math import *
import sys
lineNumber = 1
maxValue = 0
ans = 1
for line in sys.stdin:
    a, b = [int(n) for n in line.split(',')]
    t = b * log(a, 2)
    if t > maxValue:
        maxValue, ans = t, lineNumber
    lineNumber += 1

print ans
